﻿using System;
using COC.Character;
using COC.Debug;
using UnityEngine;
using System.Collections;

namespace COC.CComponent
{

    /// <summary>
    /// help game model to inject into concrete game object conveniently.方便game 模型数值注入到具体的实例游戏对象中
    /// </summary>
    public class GameObjectBridge : BaseComponent
    {

        public BaseModel GameModel;
        private long _modelId = 0L;
        public override void OnStart()
        {
            if (GameModel != null)
            {
                //写入Model Id 到该实例中，为Cache提供查找该实例对象功能来clone实例对象
                _modelId = GameModel.modelId;
                //TODO 初始化对象模型到实际的prefab中 驱动对象 写入对象日志中
                DebugTool.Log("Game Object："+GameModel.name+";"+"type:"+GameModel.type+" has included in scene.");
            }
        }

        public override string ToString()
        {
            return this.gameObject.name;
        }
    }
}